<template>
  <div class="basic-head">
    <div class="left">{{ title }}</div>
    <div class="right">
      <slot></slot>
      <el-button
        size="small"
        type="warning"
        v-if="!isCancel"
        @click="
          () => {
            $router.go(-1);
          }
        "
        >返回</el-button
      >
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      default: "",
    },
    isCancel: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style scoped lang="scss">
.basic-head {
  display: flex;
  padding: 10px 0;
  .left {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
  }
}
</style>
